import Vue from 'vue'

const requireComponent = require.context(
  './common',
  true,
  /\.vue$/
)

requireComponent.keys().forEach(fileName => {
// 获取组件配置
  const componentConfig = requireComponent(fileName)
// 全局注册组件
  Vue.component(
    componentConfig.default.name || componentConfig.name,
    componentConfig.default || componentConfig
  )
})
